<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script >
//9.静态方法
// 根据回调返回的`key` 对数组进行分组，返回一个新的`Map`。
const words = ["bat", "tab", "cat", "act", "tac", "dog"];
const grouped = Map.groupBy(words, w => w.split("").sort().join(""));

console.log(grouped);
// Map(3) {
//   'abt' => ['bat', 'tab'],
//   'act' => ['cat', 'act', 'tac'],
//   'dgo' => ['dog']
// }

console.log(typeof Map.from === "function");//false,没有这个方法
</script>
</html>